﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ArticleList.aspx.cs" Inherits="Manager_ArticleList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>产品列表</title>
    <style type="text/css">
        .x-grid3-row-body .expander
        {
            padding-left:30px;
            padding-top:5px;
            padding-bottom:5px;
        }
        .x-grid3-row-body .expander p
        {
            padding-left:30px;
            padding-top:5px;
            padding-bottom:5px;
        }
        .x-grid3-row-body .expander strong
        {
            font-weight: bold;
        }
    </style>

    <script type="text/javascript">
        if (top == window) {
            window.location.href = "../Main.aspx#/ArticleAddNew.aspx";
        }

        function openHelloFineUI() {
            var node = {
                attributes: {
                    href: "/ArticleAddNew.aspx"
                },
                text: "新增文章资料",
                id: "hello_fineui_example"
            };

            //window.parent.addExampleTab(node);
            parent.addExampleTab.apply(parent, [node]);
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManager1" runat="server" AjaxLoadingType="mask" AutoSizePanelID="gridList" />
        <ext:Grid ID="gridList" runat="server" AllowPaging="true" PageSize="25" ForceFitAllTime="true" RowNumberWidth="40px"
            EmptyText="暂时没有相关数据!" DataKeyNames="aId" ShowBorder="false" EnableRowNumber="true"
            IsDatabasePaging="true" EnableRowNumberPaging="true" AutoScroll="true" ShowHeader="false"
            EnableCheckBoxSelect="true" OnRowDataBound="gridDataList_RowDataBound" OnRowCommand="gridList_RowCommand"
            OnPageIndexChange="gridList_PageIndexChange">
            <Columns>
                <ext:TemplateField ID="tfExpander" runat="server" RenderAsRowExpander="true">
                    <ItemTemplate>
                        <div class="expander">
                            <p>
                                <strong>优化关键词：</strong><%# Eval("aKeywords")%></p>
                            <p>
                                <strong>优化关描述：</strong><%# Eval("aDescription")%></p>
                            <p>
                                <strong>概要：</strong><%# Eval("aShortInstr")%><%# Eval("aStatus") %></p>
                        </div>
                    </ItemTemplate>
                </ext:TemplateField>
                <ext:BoundField ID="bfATitle" runat="server" HeaderText="标题" DataField="aTitle" />
                <ext:TemplateField ID="tfClass" runat="server" Width="80" HeaderText="类别">
                    <ItemTemplate>
                        <asp:Label ID="lblClass" runat="server"></asp:Label>
                    </ItemTemplate>
                </ext:TemplateField>       
                <ext:BoundField ID="bfAHits" runat="server" Width="40" HeaderText="访问量" DataField="aHits" />
                <ext:CheckBoxField ID="cboxAStatus" runat="server"  HeaderText="状态" DataField="aStatus"
                    Width="40" TextAlign="center" />
                <ext:BoundField ID="bfAddTime" runat="server" HeaderText="加入时间" DataField="aAddTime"
                    Width="80" />
                <ext:BoundField ID="btAOrder" runat="server" Width="40" HeaderText="排序" DataField="aOrder" />
                <ext:WindowField TextAlign="Center" Width="30px" WindowID="winForm" Icon="basketEdit" HeaderText="编辑"
                    ToolTip="编辑" DataIFrameUrlFields="aId,aClassId" DataIFrameUrlFormatString="ArticlesAdd.aspx?ArticleId={0}&Class={1}"
                    Title="资料编辑" />                
                <ext:LinkButtonField ID="lbtnfDelete" runat="server" CommandName="Delete" ToolTip="删除当前行数据" HeaderText="删除"
                    Icon="delete" ConfirmText="是否确定删除当前行数据？" Width="30" TextAlign="center" />
                <ext:LinkButtonField ID="btnShow" runat="server" CommandName="Show" ToolTip="显示当前行数据"  HeaderText="显示"
                    Icon="accept" ConfirmText="是否确定显示当前行数据？" Width="30" TextAlign="center" />
                <ext:LinkButtonField ID="btnHide" runat="server" CommandName="Hide" ToolTip="隐藏当前行数据"  HeaderText="隐藏"
                    Icon="decline" ConfirmText="是否确定隐藏当前行数据？" Width="30" TextAlign="center" />
             </Columns>
            <Toolbars>
                <ext:Toolbar ID="Toolbar1" runat="server">
                    <Items>
                        <ext:ToolbarText ID="ToolbarText1" runat="server" Text="文章列表">
                        </ext:ToolbarText>
                        <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                        </ext:ToolbarFill>
                        <ext:Label ID="lblSearchTitle" runat="server" Text="快速检索">
                        </ext:Label>
                        <ext:DropDownList ID="ddlSearchClass" runat="server" EnableSimulateTree="true">
                        </ext:DropDownList>
                        <ext:TwinTriggerBox ID="ttboxKeywords" ShowLabel="false" OnTrigger1Click="ttboxKeywords_Trigger1Click"
                            OnTrigger2Click="ttboxKeywords_Trigger2Click" Trigger1Icon="Clear" EmptyText="搜索关键词"
                            Trigger2Icon="Search" runat="server">
                        </ext:TwinTriggerBox>
                        <ext:ToolbarSeparator ID="ToolbarSeparator" runat="server">
                        </ext:ToolbarSeparator>
                        <ext:Button ID="btnAddArticle" runat="server" Text="新增文章" Icon="Add" OnClick="btnAddArticle_Click">
                        </ext:Button>
                        <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                        </ext:ToolbarSeparator>
                        <ext:Button ID="btnSelectDelete" runat="server" Text="删除选中" Icon="delete" OnClick="btnSelectDelete_Click"
                            ConfirmText="是否确定删除？">
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </Toolbars>
            <PageItems>
                <ext:Button ID="btnRefresh" runat="server" Icon="arrowrefresh" OnClick="btnRefresh_Click">
                </ext:Button>
                <ext:ToolbarFill ID="ToolbarFill3" runat="server">
                </ext:ToolbarFill>
                <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
                </ext:ToolbarSeparator>
                <ext:ToolbarText ID="ToolbarText2" runat="server" Text="每页记录数：">
                </ext:ToolbarText>
                <ext:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
                    OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
                    <ext:ListItem Text="15" Value="15" />
                    <ext:ListItem Text="20" Value="20" />
                    <ext:ListItem Text="25" Value="25" Selected="true" />
                </ext:DropDownList>
            </PageItems>
        </ext:Grid>
        <ext:Window ID="winForm" runat="server" Hidden="true" Width="1000px" EnableMaximize="true"
            EnableResize="true" Height="650px" EnableIFrame="true" AutoScroll="true" CloseAction="hideRefresh">
        </ext:Window>
    </form>
</body>
</html>
